/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.anniversary.service.dto;

import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;

import java.io.Serializable;
import java.lang.reflect.Field;
import java.sql.Timestamp;

/**
* @website https://el-admin.vip
* @description /
* @author Jiayin Wei
* @date 2020-07-28
**/
@Data
@Getter
@Setter
public class SelectUserDto implements Serializable {
    /** 用户编号ID */
    private Long userId;

    /** 用户类型 */
    private Long userType;

    /** 名称 */
    private String name;

    /** 性别 */
    private Integer gender;

    /** 出生年月 */
    private String birthDate;

    /** 民族ID */
    private Long nationId;

    /** 政治面貌ID */
    private Long politicalId;

    /** 联系电话 */
    private String phone;

    /** 是否加入 */
    private Long joined;

    @Override
    public String toString() {
        ToStringBuilder builder = new ToStringBuilder(this);
        Field[] fields = this.getClass().getDeclaredFields();
        try {
            for (Field f : fields) {
                f.setAccessible(true);
                builder.append(f.getName(), f.get(this)).append("\n");
            }
        } catch (Exception e) {
            builder.append("toString builder encounter an error");
        }
        return builder.toString();
    }
}
